The present invention relates to computers, and more specifically, transaction processing. Transaction processing includes processing information that may be divided into several interrelated sub-operations, which are often referred to as transactions. A transaction succeeds when all the sub-operations succeed. However, if any of the sub-operations fail, so does the entire transaction. By processing a transaction as a “whole” rather than processing or treating each sub-operation individually, recovery from an error may be more efficient.
The two-phase commit protocol (2PC) is a technique used in transaction processing that coordinates the processes of a transaction, and particularly, the processes for determining whether to commit or abort the transaction. The 2PC may use state logging or log records. During execution of a transaction, the 2PC includes two phases. A first phase may be referred to as a commit-request phase, in which a coordinator attempts to prepare all the transaction's participating processes for either committing or aborting the transaction and to “vote” to either, commit or abort. A second phase may be referred to as a commit phase where, based on the voting, the coordinator decides whether to commit or abort the transaction, and sends a corresponding notification.